/* --------------------------------------------------------
 * Copyright (c) aeky , Inc.  All rights reserved.
 * --------------------------------------------------------
 */
package com.aeky.observer.observer;

import com.aeky.observer.observable.Subject;

/**
 * 观察者B
 * 
 * @author aeky
 */
public class ObserverB implements Observer {

    private Subject subject;

    public ObserverB(Subject subject) {
        this.subject = subject;
        subject.registerObserver(this);
    }

    /*
     * 
     * @see com.aeky.observer.observer.Observer#update(java.lang.Object)
     */
    @Override
    public void update(Object data) {
        System.out.println("Observer B ===>" + data.toString());
    }

    public Subject getSubject() {
        return subject;
    }

    public void setSubject(Subject subject) {
        this.subject = subject;
    }

}
